﻿<%--
 *  File:    VisitPlanFeedback4DoctorPop.jsp
 *  @Author: Tao Wei
 *  Date:    2010/11/17
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>


<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.");  
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "doctor";
  	String strTableName = "v_doctorconfsummary";
	String privilegeCode = "H0258";
	String contextPath = request.getContextPath();
  	//get current userinfo
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
	int orgid = ((Integer)CurUserInfo.get("orgid")).intValue();
  	cat.debug("The userinfo is :"+CurUserInfo);
  	cat.info("enter my page");
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc"%>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>Doctor</title>
<PageFlow:CheckPageFlow pageName="p_beforedocvisitplanfeedback"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%@ include file="/inc/InitEdit.inc" %>
<%@ include file="/rpt/ReportURL.inc" %>
<script language="JavaScript" >


function selectServiceOrder(id, doctorcode, doctorname){  
	document.cform.doctorid.value = id;
	document.cform.doctorcode.value = doctorcode;
	document.cform.doctorname.value = doctorname;
}

function page_pop(doctorid){
	var cform = document.cform;
	var ishistory = cform.ishistory.value;
	var contactid = cform.contactid.value;
	var customerid = cform.customerid.value;
	var processid = cform.uprocessid.value;
	var year = cform.year.value;
	var monthofyear = cform.monthofyear.value;
	var weekofmonth = cform.weekofmonth.value;
	var dayofweek = cform.dayofweek.value;
	var dayofmonth = cform.dayofmonth.value;
	var strUrl = "BeforeVisitPlanFeedbackDetail4Doc.jsp?<%= OvalTools.randomURL() %>";
		strUrl += "&ishistory="+ishistory+"&contactid="+contactid+"&customerid="+customerid+"&doctorid="+doctorid+"&processid="+processid;
		strUrl += "&year="+year+"&monthofyear="+monthofyear+"&weekofmonth="+weekofmonth+"&dayofweek="+dayofweek+"&dayofmonth="+dayofmonth;
	var status="height=600, width=800,top=60,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
		popwindow=window.open(strUrl, "newwindow1", status);
}

function page_summary(actionvalue,orderbyname){
  parent.down.location.href = "Blank.jsp?<%= OvalTools.randomURL() %>";
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  editform.action = "BeforeVisitPlanFeedbackDetail114.jsp";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}

function page_back(){
    var strUrl="";
    strUrl="VisitPlanEditOneDay.jsp?ishistory=<custom:write property='ishistory'/>&customerid=<custom:write property='customerid'/>&processid=<custom:write property='processid'/>&uprocessid=<custom:write property='processid'/>&contactid=<custom:write property='contactid'/>&globalpccode=<custom:write property='globalpccode'/>";
    strUrl=strUrl+"&year=<custom:write property='year'/>&monthofyear=<custom:write property='monthofyear'/>&weekofmonth=<custom:write property='weekofmonth'/>&dayofweek=<custom:write property='dayofweek'/>&dayofmonth<custom:write property='dayofmonth'/>";
	strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
    parent.location.href = strUrl;
}
</script>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="cform" method="post" action="../../Dispatcher" target="_parent">
  	<input type="hidden" name="pagename" value="p_beforedocvisitplanfeedback">
    <input type="hidden" name="actionname">
	<custom:hidden name="hospitalhash" property="orgid" changedName="customerid" />
	<custom:hidden property="contactid" />
	<custom:hidden property="year" />
	<custom:hidden property="monthofyear" />
	<custom:hidden property="weekofmonth" />
	<custom:hidden property="dayofweek" />
	<custom:hidden property="dayofmonth" />
	<custom:hidden property="processid" />
	<custom:hidden property="uprocessid" />
	<custom:hidden property="ishistory" />
	<custom:hidden property="globalpccode" />
	<custom:hidden property="vflag" />
	<table width="100%" border="0" cellspacing="0">
	  <tr><td colspan="3" class="td-text">&nbsp;</td></tr>
	  <tr>
	    <td width="10%" class="td-text" ><%= label.getLabelName("L_HospitalCode") + label.getLabelName("L_Colon") %></td>
		<td style="height:16px;padding-left:6px;font-weight:bold;font-weight:bold;background:#F5F5F5;"><custom:write name="hospitalhash" property="orgcode" /></td>
		<td width="50%" class="td-text">&nbsp;</td>
	  </tr>
	  <tr>
		<td width="10%" class="td-text"><%= label.getLabelName("L_HospitalName") + label.getLabelName("L_Colon") %></td>
		<td style="height:16px;padding-left:6px;font-weight:bold;font-weight:bold;background:#F5F5F5;"><custom:write name="hospitalhash" property="orgname" /></td>
		<td width="50%" class="td-text">&nbsp;</td>
	  </tr>
	</table>
  	<table width="100%" border="0" cellspacing="0">
  	<tr>
    	<td class="summary_top"></td>
  	</tr>
  	<%@ include file="/inc/SummarySearch.inc" %>
	</table>
  <tr> 
    <td> 
      <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center">
        <tr class="deepblue-left"> 
          <td width="1%" class="deepblue-left">&nbsp;</td>
          <td class="title_center" width="12%">&nbsp;<%= label.getLabelName("L_ContactCode") %></td>
          <td class="title_center" width="12%">&nbsp;<%= label.getLabelName("L_ContactName") %></td>
          <td class="title_center" width="12%">&nbsp;<%= label.getLabelName("L_VisitProcessName") %></td>
          <!-- <td class="title_center" width="12%">&nbsp;<%= label.getLabelName("L_visitstatus") %></td> -->
          
        </tr>
    <%
       Vector doctorsummary = (Vector)pageContext.getAttribute("doctorsummary");
       if (doctorsummary == null) doctorsummary = new Vector();

       String strClassType = "";
       String strChecked = "";
       boolean bHasChecked = false;

       Integer nDefaultDoctorId = new Integer(-1);
       String nDefaultDoctorCode = "";
       String nDefaultDoctorName = "";

    %>
    

     <logic:iterate id="summaryitem" collection="<%= doctorsummary %>" indexId="columnId">
	    <%
	       HashMap docMap = (HashMap)pageContext.getAttribute("summaryitem"); 
	       if(columnId.intValue()%2 == 1)
	       {
	         strClassType = "td-listrom";
	       }
	       else
	       {
	         strClassType = "none";
	       }
	
	       if (!bHasChecked)
	       {
	         nDefaultDoctorId = (Integer)(docMap.get("doctorid"));
	         nDefaultDoctorCode = (String)(docMap.get("doctorcode"));
	         nDefaultDoctorName = (String)(docMap.get("doctorname"));
	         
	         bHasChecked = true;
	         strChecked = "Checked";
	       }
	       else
	       {
	         strChecked = "";
	       }
	    %>
     <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'" onClick="selectServiceOrder('<custom:write name="summaryitem" property="doctorid"/>','<custom:write name="summaryitem" property="doctorcode"/>','<custom:write name="summaryitem" property="doctorname"/>')" class="<%= strClassType %>">
     
       <td>
         &nbsp;
       </td>
       <td><a onclick="page_pop('<custom:write name="summaryitem" property="doctorid"/>');"><custom:write name="summaryitem" property="doctorcode" nbsp="true" /></td>
       <td><custom:write name="summaryitem" property="doctorname" nbsp="true" /></td>
       <td><custom:write name="visitplandetailinfo" property="processname" nbsp="true" /></td>
       <!-- <td><custom:write name="summaryitem" property="visitedflag" dictType="VisitStatus" nbsp="true" /></td> -->
     </tr>
     </logic:iterate>

     <%@include file="/inc/SummaryAction.inc" %>
     <input type="hidden" name="doctorid" value="<%= nDefaultDoctorId %>">
     <input type="hidden" name="doctorcode" value="<%= nDefaultDoctorCode %>">
     <input type="hidden" name="doctorname" value="<%= nDefaultDoctorName %>">
	 </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="summary_top" ></td>
        </tr>
        <tr> 
          <td class="td_center">            
          	<!-- <a onclick="page_new()"><custom:button type="1" label="L_New" imgsrc="edit.gif" border="0" style="width:60"/></a> -->
          	<a onclick="page_back();"><custom:button type="1" label="L_Back" imgsrc="edit.gif" border="0" style="width:60" /></a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </form>
</table>
</body>
</html>
